package com.dodo.blog.ui.util;

import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * @author <a href="mailto:pohorelec@comvai.com">Jozef Pohorelec</a>
 */
public class FormatUtil
{
    public static final SimpleDateFormat DATE_FORMAT_SHORT = new SimpleDateFormat( "dd.MM.yyyy" );

    public static final SimpleDateFormat DATE_FORMAT_LONG = new SimpleDateFormat( "dd.MM.yyyy HH:mm:ss" );

    public static final SimpleDateFormat DATE_FORMAT_MONTH_YEAR = new SimpleDateFormat( "MMMM yyyy" );

    public static String formatDate( Date date, SimpleDateFormat format )
    {
        if ( date == null )
        {
            return "";
        }

        return format.format( date );
    }


}
